sciencewikiaorg_ru-20200216-history
Шаблон:Location map many/doc
Creates a location map as a composite image of an existing map in equirectangular projection, with multiple (up to 9) markers and optional labels superimposed onto it. This template functions in the style of Template:Location_map, but allows 9 markers and labels (rather than just one marker). Note: For brevity, parameters "pos" & "bg" are aliases (for "position" & "background"). : Also see: For an unlimited list of markers/labels, see: Template:Location_map+, : which specifies points as a coded template list of markers/labels. Usage Parameter locname refers to {Template:Location map locname} containing the image name and coordinates of a particular map. When a marker's mark#size=0, then that marker is skipped and only the related label is displayed, without the marker. Advisory messages Due to the numerous details of specifying 9 markers/labels, the latitude and longitude are checked to lie within the actual map limits specified in Template:Location_map_. Each marker/label is checked and can list a message (under the map), such as: :::: Latitude#4 (45.68) < map min(53.74). Processing continues, with that marker actually placed off-map, and all latitude/longitude parameters are checked, for a total of 18 possible advisory messages. Only degrees of latitude/longitude are checked, so a value of 63 minutes would be valid to indicate 1 extra degree + 3 minutes, and setting lon_min=200 could still place a marker off-map (right-side) with no warning. Also, large markers or long labels can spill over the edges of a map, allowing markers to point inward from outside the map. In such cases, a map could be centered by itself on the page ("float=center") to avoid overlapping the edge markers onto any surrounding article text. Available maps List of live templates named Template:Location_map_ (without "Template:" prefix here): Creating new maps #Find an appropriate blank map in equirectangular projection (otherwise, coordinates will drift off, typically further north) #Create a template named "Template:Location_map_''locname''" (copy the content of any other map template into it and enter appropriate values). #Set default parameter values (using those parameter names), such as setting "mark" with image-file name and "marksize" for pixels wide/tall, or set default label font size ("label_size = 78" percent). #Parameter names not used by "Template:Location_map" will be ignored by it, and only used for multiple-markers (such as defaulting "label2_size = 78" percent, or "mark2size=7" pixels). Examples Map with label "Pag" and "Anytown" (degrees) Map with 3 labels (decimal) Map with some labels outside map Map with 9 markers (decimal) Map with a custom label and text background Map with enlarged marker and label Map with no caption Western Hemisphere Country that crosses 180° meridian Implementation notes The map with markers/labels is implemented as nested HTML divisions. The map-image is in an HTML division, containing each point as a percent-locator division containing a marker-image sub-division plus a label sub-division. Each point is calculated (for a percent-locator division) with X or Y coordinate "XX.X%" or "YY.Y%" as follows: * The div-tag is " ". * Within that division the marker/label sub-divisions are coded as: :* . * For label position, the options are shifted as: :* when position=left, adds "left: -6.5em; text-align: right;" :* when position=right, adds "left: 0.5em; text-align: left;" :* when position=top, adds "top:-2.65em; left:-3em; text-align: center;" :* when position=bottom, adds "top:-0.15em; left: -3em; text-align: center;" to div-tag. See also * Template:Location map - placing one marker/label by latitude/longitude. * Template:Location map+ - placing unlimited list of markers/labels.